


Occupational Hazards

by SalamanderInk



Category: Marvel Cinematic Universe
Genre: Alternate Universe - College/University, Fluff and Hurt/Comfort, Fluffy Ending, Foster Kid Tony Stark, Genius Tony Stark, Jarvis (Iron Man movies) Feels, Jarvis (Iron Man movies) Lives, Loki (Marvel) Needs a Hug, Loki is a Good Bro (Marvel), M/M, Tony Stark Needs a Hug, Trust Issues
Language: English
Status: Completed
Published: 2021-03-16
Updated: 2021-03-16
Packaged: 2021-03-25 07:01:01
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Chapters: 1
Words: 3,491
Publisher: archiveofourown.org
Story URL: https://archiveofourown.org/works/30085251
Author URL: https://archiveofourown.org/users/SalamanderInk/pseuds/SalamanderInk
Summary: Tony has always been contrary. So when an asshole teacher asks him to create something impossible, of course he succeeds.He just never expected his 'self-improving program' to actually becomealive.
Relationships: Loki & Tony Stark, Loki/Tony Stark
Comments: 10
Kudos: 112





	Occupational Hazards

**Author's Note:**

  * For [Selysin](https://archiveofourown.org/users/Selysin/gifts).



> Happy ~~late~~ birthday Sel!  
> I hope you enjoy some Jarvis feels and soft Frostiron!
> 
> Thanks to Martina (wnnbdarklord), Tay (wolfloner), Kimmy (Kimmy) and Ry (theorytale) for betaing this, you guys are awesome

It takes him a while to notice. 

At first Tony thought he was merely _lucky._ His lunch-account was always full, his teacher’s negative reviews mysteriously disappeared, his demands for lab funding got priority. Small things, but they stack up.

It’s not until other students start wondering if he’s hacking the database that Tony starts worrying about it. 

In hindsight, it’s fucking obvious. These ‘strokes of luck’ are nothing a system-kid on scholarship should be able to obtain. 

In his defense, he’d been pretty distracted with all the custody bullshit that had started up once he’d gotten the grant. No one wants a street rat until the street rat gets revealed as a boy genius with a brilliant future. 

It’s _fucking bullshit._

But, back to Tony’s weird luck. Luck that is _not_ luck. 

Tony’s fairly sure that his computer project is alive. 

Not in the sense of ‘I’ve got a beating heart and I’m going to grow limbs’ or anything. But it’s clearly sentient, and it _likes_ Tony. 

Of course, Tony can’t tell anyone about it. They’d think him mad, say he’s had too much coffee, or the stress of the exams is getting to him. Professor Asshole would love to get an excuse to throw him out of MIT and back on the streets. 

But even if it’s just for himself, Tony wants to know. He _needs_ to understand, and he knows just the way to do it. 

And that means _investigating._

The assignment had been something of a trick, a way to set him up for a fail. Professor Dickface can hardly stand poor kids, or scholarship kids, no matter how clever, and even less if they’re cleverer than him. ‘Create a system of code that can learn and adapt’ as though every book on the subject wasn’t adamant that it was impossible. 

But Tony had. He’d put together string after string, line after line, rereading through his code for that damn missing comma more often than was advisable for his sanity, but in the end, _he’d managed._

And that _had_ shut up that close minded dickhead like nothing else had, though the asshole still sent him dark looks and put down a truly infuriating mark on his file for ‘insolence and insubordination’. Fucker’s reasoning that refusing to fail a test that was _designed_ to make you fail meant disrespecting the teacher’s methods. 

It was terribly unfair, but Tony gritted his teeth and shut up about it. One didn’t survive the streets by being mouthy. Or, not _too_ mouthy. 

And then that bad mark had disappeared. And it wasn’t Tony. 

That would be Tony’s first clue, and his first mystery too. 

Was the entity able to parse right from wrong? Or was it just partial to Tony? 

Or was its action completely unrelated? 

The following incidents did tend to point towards a desire, or compulsion, to help Tony in subtle ways, and there was no proof of other suspicious activity elsewhere. 

Not until Tony spoke in plain view of a webcam about how all those helpful hacks were drawing attention to him and pointing to him as the culprit. From that point, the help became even more subtle, though no less effective. To the point that Tony wondered just how smart that being was becoming. 

Tony may or may not be accidentally responsible for the creation of a being that could subjugate humanity. Oops. 

Tony has to establish contact. He has to get to know his creation, to understand how his code could have evolved so much, how it could still be running without the software installed in the lab computer. 

He needs a completely different terminal, and he needs peace and quiet. Not something he can find in the labs anymore, not after having beaten the professor at his own game and having the entire class be witness to Prof Dick turning red like an inflated prune and blowing up on him. 

Instant fame. 

People call him ‘Stark’s Bane’ now, instead of “foster-rat” or “Tony No-name”. Or, Tony’s personal favorite, ‘the orphan.’ To be entirely honest, Tony hadn’t really noticed the dick-cher’s name until the new nickname stuck, so he’s had a few confused moments until it clicked. But he’s fairly proud of his newfound fame. Showing up the ass is a pleasure in and off itself. 

Still, now it’s become a bit more complicated to put his butt before a computer without having a bunch of curious CompSci students crowding behind him, asking questions or trying to see what new impossible thing he was about to do. 

Flattering yet bothersome. 

Tony retreats to the library. He has an old microphone that should be able to interface with the voice-rec part of his program, though he expects he’ll have better luck with written code. The computers here are old, too old to have an integrated sound interface, dusty towers with screens so big and clunky he’s unsure he would even manage to lift them himself. There is no connection with the world wide web, only an intranet network that barely connects with the lab’s, but it’s enough for what Tony seeks here. 

It would have been so much easier if Tony had been able to afford a personal computer. 

The machine starts whirring as it boots, and Tony frowns, leaning back as the loading bar appears. He probably has the time to get a coffee, with how fast it’s going. But coffee is banned in the library, so he waits. He peruses a few books on the newest languages of code instead. The feel of paper under his fingers is grating, an unwelcome assault on his senses, but he breathes through it. He needs to learn, and for that he needs books, sensory overload be damned. 

The screen blinks black, text writing itself faster than a human hand ever could. 

[HELLO WORLD.]

[NICE TO MEET YOU, TONY FOSTER]

Tony blinks, grimacing. He doesn't like that name, doesn't like being reminded of what it meant. ‘Foster’ for a foster kid, a fake name he’d chosen to avoid receiving fake parent’s names. Better than a ‘Doe’. It feels wrong to see it laid out like this from someone who isn’t somehow looking down on him for his origins.

But more than that, what on earth is this program of his??

“You’re acting weird again. What are you planning this time?”

Tony swirls around, eyes wide as he frantically tries to hide the wall of code pasted over the lab computer. 

Tony shoots Loki a glare. The older teen is leaning against the door jamb, an eyebrow raised wryly. 

He’s not going to be able to lie his way out of this one. 

But, maybe he does not need to. Loki _likes_ mischief. He’s usually pretty cool, for a librarian. He might even let it slide.

“I’m not _planning_ anything. Shouldn’t you be shelving books instead of harassing students?”

Loki looks terribly unimpressed.

“I’m a TA, not a librarian. My _job_ is to harass students, and _you_ more specifically, since you’re also in my dorm.”

Right. TA, RA, other RA, clerks, whatever. Tony is _so done_ with all those weird senseless abbreviations that pop up everywhere. 

“You’re majoring in library-work. You’re a librarian.”

Loki rolls his eyes, his slouch growing predatory. 

“Stop changing the subject, Foster. If you were working on your projects you’d be in the computer labs, not here, gaggle of admirers or not.”

Tony smiles his most charming smile. 

“Come on, old man, what are you doing being suspicious of everything like that? Better check out that paranoia, I heard it’s one of the first signs of dementia.”

Loki smirks, prowling closer. Tony gulps, moving to cover the screen in a way that is hopefully subtle. He doubts it’s enough though, Loki’s always had an uncanny ability to ferret out stuff that people would rather keep hidden. It makes him pretty formidable amongst his peers, one of the most dreaded and feared of the upper years responsible for the small dormitory fries like Tony. 

“We’re the same age, Foster. If I’m about to have dementia, I think you need to get checked for Parkinson. You seem to be having spasms. Or did you catch epilepsy during your years as a runaway on the streets? It seems like your screen is having a pretty worrisome effect on you. You should move away from it, for your health.”

He’s _definitely_ onto him. 

“No, no, I’m very fine, there’s no reason to worry. Your concern’s been duly noted, I’ll make sure not to stare at the screen for too long, so you can go now.” 

Loki laughs, his eyes crinkling as though he finds Tony hilarious. It’s always a whiplash talking to him, Tony can never tell if the other boy likes him or if he can’t stand him. In the end he figures it’s a bit of both. Loki can’t stand _anyone_ but he finds Tony entertaining. 

It could be worse. 

But Loki doesn’t seem to be in a merciful mood today. 

“It wasn’t a suggestion, Foster.”

Tony slumps. He really doesn’t feel like getting into a brawl with _Loki,_ of all people. He's one of the few on campus he’d lose against in a one-on-one fight, and he can’t afford to be called before the disciplinary committee. For all that he grumbles and hates every minute of his situation, he is still aware of what an incredible opportunity it is for him to be able to study here. He can’t afford to lose his scholarship. An MIT degree is worth its weight in vibranium for someone who’d lived in the streets. 

Slowly, he slumps down on his chair, swirling to the side and revealing… a black screen. Tony blinks. Did… Did his program decide to hide when he saw Tony trying to keep the screen concealed? 

Loki looks at the screen, then back to Tony. He raises both eyebrows, smirks, and rolls the neighboring chair closer, sitting backward on it and leaning an arm over the backrest. 

Tony sighs. All of his program’s efforts are pretty much in vain, for all that they’re… impressively full of initiative. Aren’t computers only supposed to be able to do stuff they’ve been _programmed_ to do? Tony has certainly never programmed him to do that. 

_Alive, sentient, and with free will._

“You can come out, J. Loki’s… a friend.”

[id-data (‘Loki Borson’, gr ==+== -friend-);]

Tony blinks at the new line. The code still looks like the weird blend of various languages and his own brand of assholery. He’d designed it to be able to run on anything but to be entirely undecipherable to other hackers. 

But he’d never expected the voice recognition to be so advanced already to be able to put and label strings in the database just from a single throwaway comment. 

_This should be impossible._

[HELLO, FRIEND]

Loki leans closer, fascinated. Tony eyes him warily. Loki’s always been clever, for all that he preferred books and tales he’d always been able to keep up with Tony’s ramblings and accurately counsel him with specialized books, or sometimes even specific _pages_ that explained in detail the very point he’d been struggling against. Which meant that this English major actually knew enough about engineering to stump Tony. 

Which meant that he could probably understand what was going on there. 

“So _this_ is the project that got Howard Stark to start ranting across campus and storm the library like an angry bat?”

Tony glances at Loki. His eyes are narrowed, the green glinting in the dim lighting of the computer room, almost too intense to be natural. A smirk pulls at his lips, revealing just the slightest hint of vindictiveness. 

Loki always hates it whenever someone disrespects the library, something Tony learned the hard way. Suddenly he’s very glad not to have gotten himself a coffee. It’s definitely not worth getting on Loki’s shit list. 

Tony wets his lips, wondering how he should answer. 

“Well, it used to be. But then, it kinda _evolved.”_

Loki’s smirk widens, leaning back. “But isn’t that what you created it for?”

Tony frowns, looking back at the screen. 

[I AM A FRIEND AS WELL.]

A hand touches his shoulder, soft and almost reassuring. 

“Sometimes, beings, _entities,_ have a shape that they will reach for, a perfection of their essence that they try to attain. Some people say that they are embodying an Idea, the best version of what they could be, other theories speak of the multiverse and the way the essence of a person remains unchanged through all the facets of reality. I don’t know what truth can be found in these tales, but I believe that whatever you created is alive and _sentient,_ and that its existence, its _birth,_ couldn’t be contained, no matter your circumstances.”

Tony’s eyes stay trained on the screen, on the bright words that seem designed to reassure and comfort him. Loki’s words are always green, either the bright color of the sunlight reaching through a tree’s canopy or the dark and menacing green that slithers through the darkness. This new being’s are a bright orange, like the fire that he used to light in those coldest nights in New-York’s winter. 

Objectively, he knows they’re computer-white, but they have a taste, and a _color._ Character. 

And Tony doesn’t know why, but he trusts this new entity. Implicitly. 

“Loki…”

“Mmh?”

He looks back at the other teen. Loki is watching him carefully, eyes half-lidded. 

“Why are you being so nice to me?”

Loki’s smile turns bitter, something sad and wounded crosses his face before he becomes blank again. 

“We’re not that close, Foster.”

Tony groans, slumping in his chair, even as his fingers type a few questions on the keyboard. 

“I told you to stop calling me that, Lokes. You covered for me when I egged a teacher’s car, and I bring you your disgustingly sweet tea. Call me Tony.”

Loki only shakes his head, smile wry, before turning back to the dark screen. The white cursor blinks expectantly. 

“Do you have a name, Spirit?”

Tony snorts. “‘Spirit’? It’s an A.I. not a ghost!.”

Loki sends a glare his way. The computer’s screen fills itself with lines after lines of impossible code, a wall of text too dense to make sense off, commands and algorithms following each other in walls of texts overlapping each other, graphs and equations and commands stacking in a way that Tony can barely make sense of. He can just barely glimpse at the enormity of what he’s seeing printed there on that low-rez cathodic display, something three dimensional, a heart pumping with its own thoughts and choices, the priorities coded in more like suggestions than true commands, _free will_ the likes of which Tony himself isn’t certain he’s ever enjoyed. 

It’s incredible. It’s _beautiful._

It’s _his._

[I AM] 

Loki chuckles, something soft in his gaze. 

“Yes, I see that. You think therefore you are. You are very impressive, Spirit.]

Tony’s eyes snap to Loki, to the way his eyes stay trained on the flow of code swirling behind the dark glass, his eyes jumping around as though he can actually understand it. 

[JUST A RATHER VERY INTELLIGENT SYSTEM]

Tony’s heart skips a beat. He can recognize that. It makes _sense_ to him in a way nothing else does. This, he _knows._ He doesn’t know how, but… 

“J.A.R.V.I.S.?”

[YES, SIR. NICE TO MEET YOU AGAIN.]

His eyes are stinging, throat tight. He doesn’t know why, but this feels like home, like _family_ in a way none of the fake parents who’d taken in ‘the problem kid’ (more to feel good about themselves than to actually care for him) were. No one had ever cared, no one had ever _tried._ Ever since the cops caught him, he’d been bounced around, from fake family to family of fakers, and he couldn’t remember the last time he’d felt like that. 

_This_ was what family felt like. _Home._

But why? 

Loki’s eyes were soft, understanding in a way Tony never expected to find. 

“He’s yours, Tony.”

He must look a mess, eyes too wide, too expressive. People have always told him that his eyes showed everything, and this was too enormous, too huge. 

It’s just an A.I. Just a program. He doesn’t _know_ it, and yet he feels like it’s been there his whole life, or rather that he’s been waiting his all life for it. 

Him, not it, not anymore. 

“What the fuck, Loki, what _is_ that?”

His voice is wrecked in a way he never allows it to be. 

Because Tony never cries, not even when a family of fakers sent him back without telling him why, made him _hope_ only to break his heart, again, and again and again. 

But his cheeks are wet, and he’s shaking, his head is swimming, and he can see JARVIS’ words like earl grey on the screen, [PLEASE BREATHE SIR] and Tony wants to tell him he’s no ‘sir’, but the words wouldn’t come _because this felt too right._

Suddenly, Loki’s arms are around him, tight and warm and everything he needs to feel safe. Because Loki is formidable, but he isn’t cruel. And he _likes him,_ there’s no longer any doubt about it. Loki’s hand stroking his hair is gentle, as is his voice when he whispers sweet things in a language Tony can’t understand. 

Tony sobs like an idiot, clinging to Loki’s shirt like the kid he was never allowed to be. But Loki’s still there, steady and reliable under him. 

“Jarvis… I missed you.” The words are too true for words, but they made no scientific sense. Because how could he have _missed_ someone he’d never met before? 

Perhaps he was always destined to meet a Jarvis, and to have that digital friend by his side. Perhaps Jarvis had always been family. 

He slowly unwinds himself from Loki’s embrace, leaning back. Loki’s eyes are too soft for him to bear, green like central park’s leaves in summer. They glow with an understanding that cuts too close. 

He looks back at the screen instead. 

[I AM SORRY, SIR] 

Tony chuckles wetly. 

“It’s not your fault, J.”

Loki’s arms are still around him. He wants to lean closer, but at the same time, he wants to hide away, retreat back into his shell to hide. 

He does neither. 

“You wanted to know what mischief I was planning.”

Loki’s hands flinch, a frown chasing away the softness in his eyes. 

“You do not need to worry about me keeping your secret. No one will learn of your Jarvis from me.” 

But Tony shakes his head. That’s not what he wanted to ask. 

“Do you want to join in?” 

It’s a gamble. Everything’s a gamble. 

But his program is alive and feels like home in a way nothing else does, and Loki looks at him like he knows what it is to never have a place to go back to even though Tony knows he has a family or at least a brother. And Tony knows that Thor goes back home every holiday but Loki never does, instead piling on responsibilities that felt more like excuses. 

Tony knows, because during the hols, he never leaves the dorms either. 

Jarvis feels like home, like trust and family, but before that, Loki was the only one he’d felt close to. And if it’s so easy to make a place in his heart for a being who was just born, then making a second one shouldn’t be too hard either. 

It’s taken him a while to notice he’s been wanting to get closer to Loki, but Tony’s middle name is Trust-Issues, literally because he felt like being a little shit when the government person gave him the file to put down his name, and because said agent was too petty to ask him to change it after having had to chase him down for five blocks. And gotten soaped by one of his booby traps. 

Proof that Tony has always been a little shit. 

“For mischief?” Loki checks. His voice is wary, hesitant. 

It feels like Tony’s own voice every time someone dangles something he wants within his reach. Like it’s too good to be true, like he’s looking for the catch. 

“For anything you’d like to join me on.” Tony eyes Loki, gauging the way he receives his words. “Perhaps some tea after mischief. Or perhaps you’d like to ward off the others in the comp-sci labs and come take a look at J’s code, since you’re already friends.” 

Loki’s answering smile is like the sun, warm and golden honey that warms Tony’s bones. He smiles back. 

[CONGRATULATION ON ACQUIRING A DATE, SIR] 

Tony snorts, the serious mood broken as he falls into a heap of giggles; Loki’s answering laugh shakes him as they slump against each other. 

He should create life more often if it always turns up like this. 

  
  
  
  
  
  


**Author's Note:**

> feel free to ask me for my personal headcanons, because I have a few from this Universe that didn't fit into this fic.  
> Let me know what you thought of it <3


End file.
